package edu.sctu.yueding.config;

/**
 * Created by 鑫爷您慢点 on 2016/8/2.
 */
public class URLConfig {

//    public static final String ROOT = "http://118.178. 86.71:8080";
//    public static final String ROOT = "http://120.27.246.236:8080";
//    public static final String ROOT = "http://172.16.10.37:18080";
    public static final String ROOT = "http://yunwei.sctu.edu.cn:18080";
//    public static final String ROOT = "http://123.207.237.16:8080";

    public static final String URL = ROOT + "/yueding-service/api/v1/";
    public static final String URL_V2 = ROOT + "/yueding-service/api/v2/";
//    public static final String URL = ROOT + "/api/v1/";

    //pay test
//    public static final String URL = "http://172.30.39.1:8080/api/v1/";

    /**
     * 个人中心
     */

    public static final String REFRESH_TOKEN = URL + "oauth/token?";

    public static final String SMS_VERIFICATION = URL + "sms/send?";
    public static String LOGIN = URL + "login";
    public static String REGISTER = URL + "register";
    public static String RESET_PASSWORD = URL + "resetPassword";
    public static String USER_INFO = URL + "user/profile";
    public static String MY_TEAMS = URL + "user/teams";
    public static String MY_TEAMS_MEMBER = URL + "user/team/members";
    public static String MY_FRIENDS = URL + "users/friends";
    public static String MY_SIGN_UP = URL + "user/enroll";
    public static String MY_SIGN = URL_V2 + "enroll";
    public static String MY_ORDERS = URL + "orders";
    public static String MY_WAIT_ORDER = URL + "order";

    public static String MY_ALIPAY = URL + "orderStr";
    public static String MY_WX_PAY = URL + "wxpayPayRequest";

    public static String getMyWxPay(Long id) {
        return MY_WX_PAY+ "?orderId=" + id;
    }
    public static String getMyAlipay(Long id) {
        return MY_ALIPAY+ "?orderId=" + id;
    }


    public static String updateMember(Long id) {
        return URL + "participants/" + id;
    }
    public static String getDeleteOrder(Long id) {
        return MY_WAIT_ORDER + "/" + id;
    }

    public static String getMyOrderDetil(Long id) {
        return MY_ORDERS + "/" + id;
    }

    public static String getSmsVerification(String phone) {
        return SMS_VERIFICATION + "phone=" + phone;
    }

    public static String getMyTeamsMember(Long matchId) {

        return URL + "user/matches/" + matchId + "/members";
    }

    public static String getMyTeamMember(int teamId) {

        return URL + "teams/" + teamId + "/members";
    }

    public static String getChatToken(String userId) {

        return URL + "chat/token/" + userId;
    }

    public static String getSerachUrl(String nickname) {

        return URL + "users/friends/nickname/" + nickname;
    }

    public static String getMyQrcodeUrl(Long userId) {

        return URL + "users/friends/friendId/" + userId + "/type/3";
    }

    public static String addFriend(Long userId) {

        return URL + "users/friends/friendId/" + userId;
    }

    public static String getAddTeamMemberPath(Long teamId) {
        return URL + "teams/" + teamId + "/members";
    }


    public static String getZanURL(long tweetsId) {
        return URL + "tweets/" + tweetsId + "/praises";
    }

//    public static final String URL = "http://192.168.103.73:8080/";

    public static String getChooseRoute(String matchId) {
        return URL_V2 + "matches/" + matchId + "/routes";
    }

    /**
     * 首页
     */
    public static final String URL_HOME_HEAD = URL + "thumbnails/match/articles/";
    public static final String URL_ONE_MATCH (int id){
        return URL + "admin/matches/" + id;

    }

    public static final String URL_ONE_NEWS (int id){
        return URL_V2 + "articles/" + id;
    }

    public static final String URL_BANNER = URL_V2 + "thumbnails";

    public static final String URL_HOME_LIST = URL + "thumbnails/normal/articles";
    public static final String URL_HOME_VOTE = URL + "votes";
    public static final String URL_HOME_MATCHES = URL + "matches";


    public static String URL_EDIT_MYINFO(Long teamId) {
        return URL + "user/" + teamId + "/profile";
    }


    /**
     * 社区
     */
    public static final String URL_COMMUNITY = URL + "users/tweets";
    public static final String URL_COMMUNITY_COMMENT = URL + "comments";
    public static final String URL_COMMUNITY_UPLOAD_TWEETS = URL + "users/tweets";

    public static final String URL_COMMUNITY_DELETE(long id){
        return URL + "tweets/" + id + "/delete";
    }

    public static final String URL_COMMUNITY_SHARE(long id){
        return URL + "tweets/" + id + "/share";
    }


    /**
     * 报名、添加成员
     */
    public static final String URL_CREATE_TEAM = URL + "user/teams";
    //    public static final String URL_ENROLL = URL + "enroll";
    public static final String URL_ADD_TEAM_MEMBERS = URL_V2 + "teams/";

    public static final String BEAREAR = "Bearer ";

    public static final String SIGN_IN_PROTOCOL = ROOT + "/yueding-service/api/v2" + "/protocols/insurance";
//    public static final String SIGN_IN_PROTOCOL = ROOT + "/protocols/insurance";

//    public static String APP_UPDATE =  "http://172.16.10.50:18080/iconsult/api/v1/versions/newest";

    public static String APP_UPDATE = URL + "versions/newest";

    public static final String URL_PAY_ORDER = URL_V2 + "order";

    public static String URL_PAY_SUCCESS(long orderId) {
        return URL + "orders/" + orderId + "/surePaySuccess";
    }

    public static String URL_POST_TEAM_NAME(long teamId) {
        return URL + "teams/" + teamId;
    }



}
